//
//  NSObject+YXImageBrowser.m
//  YXImageBrowserDemo
//
//  Created by guo peng huang on 2021/5/18.
//
#import "NSObject+YXImageBrowser.h"
#import <objc/runtime.h>

@implementation NSObject (YXImageBrowser)

static void *YXOriginAlphaKey = &YXOriginAlphaKey;
- (void)setYx_originAlpha:(CGFloat)yx_originAlpha {
    objc_setAssociatedObject(self, YXOriginAlphaKey, @(yx_originAlpha), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (CGFloat)yx_originAlpha {
    NSNumber *alpha = objc_getAssociatedObject(self, YXOriginAlphaKey);
    return alpha ? alpha.floatValue : 1;
}

@end
